//
//  APPUserDataManager.m
//  IMDome
//
//  Created by 崔志伟 on 2020/8/22.
//  Copyright © 2020 czw. All rights reserved.
//

#import "APPUserDataManager.h"

@implementation APPUserDataManager
+(instancetype)shareInstance
{
    static APPUserDataManager *userInfoManager = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        userInfoManager = [[APPUserDataManager alloc]init];
    });
    return userInfoManager;
}
- (instancetype)init{
    if (self = [super init]) {
        self.token = @"";
        if ([[NSUserDefaults standardUserDefaults] objectForKey:IM_TOKEN_KEY]) {
            self.token =  [[NSUserDefaults standardUserDefaults] objectForKey:IM_TOKEN_KEY];
        }
        self.userId = @"";
        
        if ([[NSUserDefaults standardUserDefaults] objectForKey:IM_USER_ID_KEY]) {
            self.userId =  [[NSUserDefaults standardUserDefaults] objectForKey:IM_USER_ID_KEY];
        }
    }
    return self;
}

- (void)removeUserData{
    self.token = @"";
    self.userId = @"";
}
@end

